#include "LearnSerialization.h"
#include <iostream>

using namespace std;

void showSerializationDemoMenu()
{
	cout << "**********************************************************" << endl;
	cout << "Serialization 学习案例菜单:" << endl;
	cout << "输入对应选项索引号并回车进入：" << endl;
	cout << "  1. 案例一：简单 Json 解析演示（基于 json11 库）" << endl;
	cout << "  2. 案例二：简单 Json 解析演示（基于 jsonCpp 库）" << endl;
	cout << "  3. 案例三：简单 Protobuf 解析演示" << endl;
	cout << "  Q. 退出；" << endl;
	cout << "**********************************************************" << endl;
	cout << "请输入:" << endl;
}

void gotoSerializationDemoMenu()
{
	char commond;
	while (showSerializationDemoMenu(), cin >> commond, 'q' != tolower(commond))
	{
		switch (tolower(commond))
		{
		case '1':
			runDemoOfJson11();
			break;
		case '2':
			runDemoOfJsonCpp();
			break;
		case '3':
			runDemoOfProtobuf();
			break;
		}
	}
}